<html>
<head><meta charset="utf-8"><title>using rustc with a different LLVM version · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/using.20rustc.20with.20a.20different.20LLVM.20version.html">using rustc with a different LLVM version</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="213378735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/using%20rustc%20with%20a%20different%20LLVM%20version/near/213378735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/using.20rustc.20with.20a.20different.20LLVM.20version.html#213378735">(Oct 15 2020 at 04:10)</a>:</h4>
<p>I'm thinking about distributing a rustc built with a debug mode LLVM, for finding bugs in LLVM</p>



<a name="213378739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/using%20rustc%20with%20a%20different%20LLVM%20version/near/213378739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/using.20rustc.20with.20a.20different.20LLVM.20version.html#213378739">(Oct 15 2020 at 04:11)</a>:</h4>
<p>however, building rustc and all the versions of std I need with a debug LLVM is painfully slow</p>



<a name="213378756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/using%20rustc%20with%20a%20different%20LLVM%20version/near/213378756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/using.20rustc.20with.20a.20different.20LLVM.20version.html#213378756">(Oct 15 2020 at 04:11)</a>:</h4>
<p>is there any way to use/distribute a different build of LLVM than the one used to build rustc?</p>



<a name="213378811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/using%20rustc%20with%20a%20different%20LLVM%20version/near/213378811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/using.20rustc.20with.20a.20different.20LLVM.20version.html#213378811">(Oct 15 2020 at 04:12)</a>:</h4>
<p>(I have access to lots of cores so building LLVM twice isn't a huge deal)</p>



<a name="213380041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/using%20rustc%20with%20a%20different%20LLVM%20version/near/213380041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/using.20rustc.20with.20a.20different.20LLVM.20version.html#213380041">(Oct 15 2020 at 04:45)</a>:</h4>
<p>Hmm, <span class="user-mention" data-user-id="116122">@simulacrum</span> got dynamic linking working on Linux - maybe you could choose a different version of llvm to link depending on what you use it for?</p>



<a name="213410003"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/using%20rustc%20with%20a%20different%20LLVM%20version/near/213410003" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/using.20rustc.20with.20a.20different.20LLVM.20version.html#213410003">(Oct 15 2020 at 11:23)</a>:</h4>
<p>It is in theory possible, yeah. We have assertion enabled builds of LLVM in Rust CI, though that's not debug mode.</p>



<a name="213470745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/using%20rustc%20with%20a%20different%20LLVM%20version/near/213470745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/using.20rustc.20with.20a.20different.20LLVM.20version.html#213470745">(Oct 15 2020 at 18:50)</a>:</h4>
<p>so I guess this would involve swapping the <a href="http://libLLVM.so">libLLVM.so</a> in the distribution.. and maybe I can build only that with <code>./x.py build src/llvm-project</code></p>



<a name="213470900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/using%20rustc%20with%20a%20different%20LLVM%20version/near/213470900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/using.20rustc.20with.20a.20different.20LLVM.20version.html#213470900">(Oct 15 2020 at 18:51)</a>:</h4>
<p>you could use different build directories with different configs, then swap the <code>libLLVM.so</code></p>



<a name="213470932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/using%20rustc%20with%20a%20different%20LLVM%20version/near/213470932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/using.20rustc.20with.20a.20different.20LLVM.20version.html#213470932">(Oct 15 2020 at 18:51)</a>:</h4>
<p>(<code>x.py</code> doesn't have to be in the current directory)</p>



<a name="213481850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/using%20rustc%20with%20a%20different%20LLVM%20version/near/213481850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/using.20rustc.20with.20a.20different.20LLVM.20version.html#213481850">(Oct 15 2020 at 20:19)</a>:</h4>
<p>I'll try that. Thanks!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>